/****************************************\
|* MFZPSP LLE PSP Emulator              *|
|* Copyright (c) 2008 Mauro Frischherz  *|
|* See License.txt for details          *|
\****************************************/

#ifndef COREWRAPPER_H_
#define COREWRAPPER_H_

#include "types.h"

/* Emulation */

bool PSPReset(); // Resets CPU, clears memory and registers
bool PSPStart(); // Starts CPU, will not run unless valid rom is loaded

bool PSPPause(); // Pauses CPU
bool PSPResume(); // Resumes CPU-Operation


/* CPU */

extern int GetCPUState(); // CPU States defined in types.h

bool PSPSingleStep(); // Single-Step debugging

// GUI-Registers_______________________________________
uint GetCPURegister(int index); // Returns CPU-Register
void GetCPURegisterText(int index, char* dest); // Returns Text
uint GetProgramCounter();

// GUI-Disasm_________________________________________________________________________
// fills a uint array with the memory addresses and another with actual opcodes itself
void GetCPUCode(uint pc, char* pclist, char* operation, char* opcode, char* comment);


/* Memory */

// GUI-Memory_________________________________________________________________
// fills int array with mem dump and string with ascii dump, modes in types.h
void MemDump(uint address, char* hexdump, char* asciidump, int mode);

bool LoadFile(char* path); // Does all the loading and initialisation needed


#endif /*COREWRAPPER_H_*/ //
